package br.com.pd.middleware;

import br.com.named.NamingClient;
import br.com.pd.messaging.TransportException;
import br.com.util.PropertiesLoader;


public class InitialContext implements InitialContextIF {

	private String remotAddress;
	private int remotePort;
	
	public InitialContext(){
		this.remotAddress = PropertiesLoader.getInstance().getPropertie(PropertiesLoader.LOCATION_REMOTE_OBJECT);
		this.remotePort = Integer.parseInt(PropertiesLoader.getInstance().getPropertie(PropertiesLoader.PORT_MANAGER_RECEIVER));
	}
	
	
	public Object lookup(String name) {
		Object ret = null;
		try {
			NamingClient named = new NamingClient();
			ret = named.search(name);
		} catch (TransportException e) {
			e.printStackTrace();
		}
		return ret;
	}
	
	


}
